<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Examples of Using the Translator Plugin - SIMPLE EXAMPLE</title>
<meta name='author' content='Caridy Patino (caridy at gmail.com)' />
<!-- Reset and Fonts -->
<link rel="stylesheet" type="text/css" href="../assets/example.css">
<!-- YUI Basement Style -->
<script type="text/javascript" src='http://yui.yahooapis.com/2.2.2/build/utilities/utilities.js'></script>
<script type="text/javascript" src='../../../yui-cms/build/ext/json.js'></script>
<script type="text/javascript" src='../../../yui-cms/build/translator/translator.js'></script>
<script type="text/javascript">
(function() {
// short hands	
var $L = YAHOO.lang,
    $E = YAHOO.util.Event,
    $T = YAHOO.util.Translator;
	
  // language initialization (spanish)
  $T.init ({lang:'esp', charset:'iso-8859-1'});
  $T.load ('COMMON', {onReady: function () { 
    alert ('The COMMON language module is ready. Current lang: ' + $T.getLang() ); 
  }});

  YAHOO.example.Translation = function () {
	// creating the english link
	YAHOO.util.Event.addListener('loadenligsh', "click", function () {
	  // reinitialization to spanish, the initialization process include the reloading process for current modules thru AJAX...
	  $T.init ({lang:'eng', charset:'utf-8'});
	});
	
	// creating the spanish link
	YAHOO.util.Event.addListener('loadspanish', "click", function () {
	  // reinitialization to spanish, the initialization process include the reloading process for current modules thru AJAX...
	  $T.init ({lang:'esp', charset:'iso-8859-1'});
	});

	// creating the example links
	YAHOO.util.Event.addListener('showyes', "click", function () {
	  alert ( '_MESSAGE'.translate('COMMON') + ': ' + '_YES'.translate('COMMON') );
	});
	YAHOO.util.Event.addListener('showno', "click", function () {
	  alert ( '_MESSAGE'.translate() + ': ' + '_NO'.translate() );
	});
  };

  $E.addListener(window, "load", YAHOO.example.Translation ); 

})();
</script>
</head>
<body id="cms-body">

<div id="doc">

	<div class="path">
	  <a href="http://bubbling.comarq.com/" target="_top">Bubbling Library</a> &gt; <a href="http://bubbling.comarq.com/eng/examples" target="_top">Examples</a>
	</div>

  <h1>Examples of Using the Translator Plugin - ADVANCED EXAMPLE </h1>
	
	<p>Use this package to separate the language sentences from your javascript components. In this case, the language sentences are loading onDemand.</p>
	<p><a href="#" id="showyes" title="Click to see the message">Click here to show the YES messege in the current language</a></p>
    <p>
  <a href="#" id="showno" title="Click to see the message">Click here to how the NO messege in the current language</a></p>
  <p>In this example, the default language is <a href="#" id="loadspanish" title="Click to switch the language to english">SPANISH</a>, but you can switch to <a href="#" id="loadenligsh" title="Click to switch the language to english">ENGLISH</a> language (click on the links). </p>
</div>



</body>
</html>